package com.zhangxin.tree;

/**
 * 定义一个二叉树节点: 二叉树由根节点和左节点以及右节点组成
 *
 *
 * @since 2021-01-31
 */
public class TreeNode<T> {
    private TreeNode left;
    private TreeNode right;
    private T value;

    public TreeNode() {
    }

    public TreeNode(T value) {
        this.value = value;
    }

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public void setLeft(TreeNode left) {
        this.left = left;
    }

    public TreeNode getLeft() {
        return left;
    }

    public void setRight(TreeNode right) {
        this.right = right;
    }

    public TreeNode getRight() {
        return right;
    }
}
